package org.ytor.core.sqlflow.dsl;

import org.ytor.core.sqlflow.dsl.dsqlfile.DsqlSegment;

import java.util.HashMap;
import java.util.Map;

/**
 * created by yangtong on 2025/8/12 17:25:58
 * <br/>
 * DSL 内容缓存
 */
public class DslCache {

    private static final Map<String, DsqlSegment> cache = new HashMap<>();

    /**
     * 注册 DSL段落
     */
    public static void register(String id, DsqlSegment segment) {
        DslCache.cache.put(id, segment);
    }

    /**
     * 根据ID获取 DSL段落
     */
    public static DsqlSegment get(String id) {
        return DslCache.cache.get(id);
    }
}
